//
// Created by ubuntu on 2020/12/24.
//

#define LOG_TAG "fht"

#include <android/log.h>
#include <hidl/HidlSupport.h>
#include <hidl/HidlTransportSupport.h>
#include <vendor/hardware/bearpi/1.0/IBearPi.h>
#include <vendor/hardware/bearpi/1.0/types.h>
#include "BearPi.h"

using vendor::hardware::bearpi::V1_0::IBearPi;
using vendor::hardware::bearpi::V1_0::implementation::BearPi;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::sp;
using android::status_t;

int main(){
    ALOGD("Bearpi service start ");
    android::sp<IBearPi> bearpi = BearPi::getInstance();
    configureRpcThreadpool(1, true /*callerWillJoin*/);

    const status_t status = bearpi->registerAsService();
    if (::android::OK != status) {
        ALOGE("Can't register service of bearpi\n");
        return 1;
    }
    ALOGD("Bearpi service registerAsService ");

    joinRpcThreadpool();

    return 1; // should never get here
}

